<template>
  <section style="padding-bottom: 30px;">
    <div class="big_pt" v-if="message == '请求成功'">
      <div class="tit">
        <img src="../../assets/index/line.png" class="line">
        <span class="weight">驾驶证信息</span>
      </div>
      <ul>
        <li>
          <span>驾驶证号</span>
          <span>{{resultData.licenseNo}}</span>
        </li>
        <li>
          <span>累计计分</span>
          <span>{{resultData.score}}</span>
        </li>
        <li>
          <span>准驾车型</span>
          <span>{{resultData.type}}</span>
        </li>
        <li>
          <span>有效期始</span>
          <span>{{resultData.startDate}}</span>
        </li>
        <li>
          <span>有效期至</span>
          <span>{{resultData.dueDate}}</span>
        </li>
        <li>
          <span>初次登记日期</span>
          <span>{{resultData.recordDate}}</span>
        </li>
        <li>
          <span>驾驶证状态</span>
          <span>{{resultData.state}}</span>
        </li>
        <li>
          <span>档案编号</span>
          <span>{{resultData.fileNo}}</span>
        </li>
      </ul>
    </div>
    <div v-else>
      <img src="../../assets/sech/no_tip.png" style="width: 4rem;margin-top: .86rem;">
      <p style="margin-top: .3rem;color: #666;">{{message}}</p>
    </div>
  </section>
</template>

<script>
  export default {
    name: "licenseSearchResult",
    data() {
      return {
        message:'',
        idCard:'',
        quasiDrivingType:'',
        scoring:'',
        driverStatus:'',
        firstIssueDate:'',
        termoFvalidity:'',
        fileNumber:'',
        trafficpolice:'',
        resultData: {}
      }
    },
    created() {
      let RESULTINFO = JSON.parse(sessionStorage.getItem('TO_OBJECT'));
      console.log(RESULTINFO)
      this.message = RESULTINFO.message;
      if(this.message == '请求成功'){
        this.resultData = RESULTINFO.resultInfo;
        if (this.resultData.recordDate) this.resultData.recordDate = this.resultData.recordDate.split(' ')[0];
        if (this.resultData.startDate) this.resultData.startDate = this.resultData.startDate.split(' ')[0];
        if (this.resultData.dueDate) this.resultData.dueDate = this.resultData.dueDate.split(' ')[0];
      }
    }
  }
</script>

<style scoped>
  .line {
    width: 5px;
    height: 25px;
    position: absolute;
    left: 0;
  }

  .tit {
    display: flex;
    align-items: center;
    height: 1rem;
  }

  .big_pt {
    padding: 0rem .3rem 0rem .3rem;
    box-shadow: 2px 2px 10px rgba(128, 128, 128, .2);
  }

  .big_pt ul {
    padding-top: .3rem;
    border-top: 1px solid #f2f2f2;
  }

  .big_pt li {
    display: flex;
    text-align: left;
    padding-bottom: .3rem;
    align-items: center;
  }

  .big_pt li span:nth-child(1) {
    width: 2.4rem;
    color: #929292;
    flex: none;
  }

</style>
